using System;

namespace Pegasus.Workflow.Service
{
	/// <summary>
	/// The base class for custom data exchange services 
	/// </summary>
	public abstract class WorkflowDataExchangeService : IWorkflowService
	{
		// Local Instance Values
		private WorkflowService m_workflowService = null;

		/// <summary>
		/// Initializes a new instance of the <see cref="T:WorkflowDataExchangeService"/> class.
		/// </summary>
		public WorkflowDataExchangeService()
		{
		}

		/// <summary>
		/// Gets the workflow service that this service is attached to.
		/// </summary>
		/// <value>The workflow service.</value>
		public virtual WorkflowService WorkflowService
		{
			get
			{
				return m_workflowService;
			}
		}

		/// <summary>
		/// Starts this instance of the service.
		/// </summary>
		/// <param name="workflowService">The workflow service that owns this service.</param>
		public virtual void Start( WorkflowService workflowService )
		{
			m_workflowService = workflowService;
		}

		/// <summary>
		/// Stops this instance of the service.
		/// </summary>
		public virtual void Stop()
		{
			m_workflowService = null;
		}
	}
}
